package com.le.edu.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 课程科目
 *
 * @TableName t_subject
 */
@TableName(value = "t_subject")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Subject extends BaseEntity implements Serializable {
    /**
     * 课程类别ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long subjectId;

    /**
     * 类别名称
     */
    private String title;

    /**
     * 父ID
     */
    private Long pid;

    /**
     * 排序字段
     */
    private Integer sort;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    @TableLogic
    private String delFlag;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Subject> children;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}